package br.com.advance.automacao.services.impl;

import java.util.Date;
import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import br.com.advance.automacao.dao.MTBFDao;
import br.com.advance.automacao.model.MTBF;
import br.com.advance.automacao.services.EthernetIp4JService;
import br.com.advance.automacao.services.MTBFService;

@Service
@Transactional("transactionManager")
public class MTBFServiceImpl implements MTBFService {

	private static final Logger logger = Logger.getLogger(MTBFServiceImpl.class);

	@Autowired
	private MTBFDao mtbfDao;

	@Autowired
	private EthernetIp4JService ethernetIp4JService;

	@Override
	public MTBF criar(MTBF clp) {
		return mtbfDao.create(clp);
	}

	@Override
	public MTBF buscarPorId(Long id) {
		return mtbfDao.findById(id);
	}

	@Override
	public List<MTBF> buscarPorFiltro(Long idCLP, Long idTurno, Date dataTurno) {
		return mtbfDao.buscarPorFiltro(idCLP, idTurno, dataTurno);
	}

	@Override
	public void deletarMTBFPorClpDataTurno(Long idTurno, Date data,
			Long idCLP) {
		mtbfDao.deletarMTBFPorClpDataTurno(idTurno, data, idCLP);
	}

}
